﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IcqSharp
{
    public enum Capability
    {
        ServerRelay,
        UTF,
        RTF,
        Contacts,
        Typing,
        IcqDirect,
        xTraz,
        File,
        StatusMessages,
        StatusMood,
        xStatus
    }

    public class Capabilities
    {
        
        private static Dictionary<Guid, Capability> OscarCapabilities;

        static Capabilities()
        {
            OscarCapabilities = new Dictionary<Guid, Capability>();

            OscarCapabilities[new Guid("49134609-7f4c-d111-8222-444553540000")] = Capability.ServerRelay;
            OscarCapabilities[new Guid("4e134609-7f4c-d111-8222-444553540000")] = Capability.UTF;
            OscarCapabilities[new Guid("5127b197-3c24-3443-ad22-d6abf73f1492")] = Capability.RTF;
            OscarCapabilities[new Guid("4b134609-7f4c-d111-8222-444553540000")] = Capability.Contacts;
            OscarCapabilities[new Guid("09c83f56-6f0b-bd41-9f79-422609dfa2f3")] = Capability.Typing;
            OscarCapabilities[new Guid("44134609-7f4c-d111-8222-444553540000")] = Capability.IcqDirect;
            OscarCapabilities[new Guid("6c3c091a-fdd7-c54e-9d51-a6474e34f5a0")] = Capability.xTraz;
            OscarCapabilities[new Guid("43134609-7f4c-d111-8222-444553540000")] = Capability.File;
        }

        public static List<Capability> GetCapabilities(List<Guid> caps)
        {
            var res = new List<Capability>();

            foreach (var cap in caps)
                if (OscarCapabilities.ContainsKey(cap))
                    res.Add(OscarCapabilities[cap]);

            return res;
        }
    }
}
